package com.itheima.case2.web;


import com.itheima.case2.pojo.po.Role;
import com.itheima.case2.service.impl.RoleServiceImpl;
import com.itheima.case2.utils.BaseController;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/role/*")
public class RoleServlet extends BaseServlet {

    private void query(HttpServletRequest request, HttpServletResponse response) throws IOException {
             //获取请求参数
            //调用业务层的查询方法
            RoleServiceImpl service = new RoleServiceImpl();
            List<Role> list = service.findAllRoles();

            //响应给客户端
            BaseController.printResult(response,list);
    }


}
